<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html>
<html lang="zh_cn">
<head>
    <meta charset="UTF-8">
    <title>文档管理系统后台</title>
<script src="${pageContext.request.contextPath}/js/jQuery.js"></script>
    <style>
        *{ 
        	padding:0; 
        	margin:0;
        }
        img{ 
        	display:block;
        }
        html{ width:100%; height:100%; font-family:"微软雅黑"; background-image:url(../images/bg.jpg); background-repeat:no-repeat; background-position:center; background-size:cover; position:relative;}

        .djzzlogo{ width:6%; height:2%; margin:2%;}

        .jituanlogo{ width:6%; height:6%; margin:4% auto 0 auto;}
        h1{ font-size:2vw; color:#FFFFFF; text-shadow:2px 2px 6px #101d3e; line-height:300%; font-weight:normal; text-align:center;  margin-bottom:5%;}
        /*登录*/
        #login input{ display: block; width:16vw; height:6vh; margin: 3vh auto; border-radius:4vh; border: 1px solid white; outline: none; padding-left:3.6vw; font-family:"微软雅黑"; font-size: 1.2vw; color:#FFFFFF; background:none; background-repeat: no-repeat; background-size: 4vh; background-position:1.5vh 1vh; opacity:0.7; -webkit-opacity:0.7;}
        #login input:focus{ background-color:rgba(7,54,80,0.3); opacity:1;}
/*         #login input[type=text]{ background-image: url(/Image/zhanghao.png);}
        #login input[type=password]{ background-image: url(/Image/mima.png);} */
        #login input::-webkit-input-placeholder{color: white; opacity:0.6;}/*webkit内核 chrome safari*/
        #login input:-moz-placeholder{color: white; opacity:0.6;}/*firefox 18-*/
        #login input::-moz-placeholder{color: white; opacity:0.6;}/*webkit内核 firefox 19+*/
        #login input:-ms-input-placeholder{color: white; opacity:0.6;}/*ie10*/
        /*提示信息*/
        #login p{ width: 20vw; margin: 0 auto; font-size: 1vw; line-height:7vh; text-align:center; color:#FF0027;}
        /*登录按钮*/
        #login button{ display:block; width: 20vw; height:6vh; margin: 4vh auto 2vh auto; border: none; outline: none; border-radius:4vh; background-color: #3683a0; font-family:"微软雅黑"; font-size: 1.2vw; color: white; line-height:6vh; cursor:pointer; opacity:0.7; -webkit-opacity:0.7; }
        #login button:active{ opacity:0.5;}
        #login button:disabled{ background-color: #707070;}
    </style>
</head>
<body>
    <div class="content">
<!--         <img src="/Image/djzzlogo.png" alt="" class="djzzlogo">
        <img src="/Image/lbjtlogo_red.png" alt="" class="jituanlogo"> -->
        <h1>软件企业研发过程管理系统</h1>
        <div id="login">
            <input type="text" id="userName" placeholder="请输入账号" />
            <input type="password" id="password" placeholder="请输入密码" />
            <!--提示文字-->
            <button id="btnLogin">登录</button>
            <button id="register">注册</button>
            <p style="display: none">用户名或密码错误！</p>
        </div>
    </div>
</body>
<script >
$(function () {

	$("#btnLogin").click(function () {
		
		$.ajax({  
	        type: "post",  
	        url: "/parts/user/userLoginWeb.do",  
	        data: {userName:$("#userName").val(), userPwd:$("#password").val() },  
	        dataType:"JSON",  
	        /* beforeSend: function(){  
	            $("#span_content").text("数据处理中...");  
	        },   */
	        //success: function(msg){  
	        //    $("#show").html(msg);  
	  
	        success:function(t){  
	        	t = eval('('+t+')');
	        	if(t.code  == 1){  
                    // console.log(t);
	            	 window.location.href = t.url; 
	            }else{  
	            	alert('用户名或密码错误');
	            }  
	        }  
	  
	    });  
		
	});

    $("#register").click(function(){
        window.location.href="/parts/views/register.jsp"
    })
});
</script>
</html>